package basic.com.liz.learn.design.chain;

public class MyHandler extends AbstractHandler implements Handler
{
    private String name;
    
    private int i = 0;
    
    public MyHandler(String name)
    {
        super();
        this.name = name;
    }
    
    @Override
    public void operator()
    {
        Handler h = getHandler();
        System.out.println(name);
        i++;
        System.out.println(i);
        if (null != h && i < 10)
        {
            h.operator();
        }
    }
    
}
